﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Jzy.Model.CRM;
using Frame.Lib.Core.Base;
using Frame.Lib.Utilities;


namespace Jzy.DAL.CRM
{
    public class CustomerContactDAL : BaseDAL
    {
        public List<CustomerContactInfo> GetList(int customerID)
        {
            string sql = "select * from " + OTableName.CustomerContact + " where IsDelete = 0 and CustomerID=@p0";

            List<CustomerContactInfo> list = dbOper.Query<CustomerContactInfo>(sql, customerID);
            return list;
        }

        public void LogicDelete(List<int> lstIDs)
        {
            string ids = ConvertUtil.ConvertToDbStr(lstIDs);

            string sql = "update " + OTableName.CustomerContact + " set IsDelete=1 where ID in (" + ids + ")";

            dbOper.RunSql(sql);
        }
    }

}
